import request from '@/utils/request'

export default{
  // 根据课程id来获取所有课程大纲信息
  getChapterVideoByCourseId(courseId){
    return request({
      url: `/eduservice/chapter/getChapterVideo/${courseId}`,
      method: 'get'
    })
  },
  // 添加章节信息
  addChapter(chapterInfo){
    return request({
      url: '/eduservice/chapter/addChapter',
      method: 'post',
      data: chapterInfo
    })
  },
  // 根据章节id来查询章节信息
  getChapterInfoById(chapterId){
    return request({
      url: `/eduservice/chapter/getChapterInfo/${chapterId}`,
      method: 'get'
    })
  },
  // 根据章节id来更新章节信息
  updatedChapterInfo(chapterInfo){
    return request({
      url: '/eduservice/chapter/updatedChapter',
      method: 'post',
      data: chapterInfo
    })
  },
  // 根据id来删除章节信息
  deletdChapterById(chapterId){
    return request({
      url: `/eduservice/chapter/${chapterId}`,
      method: 'delete'
    })
  }
}